package com.example.demo.Service;

import com.example.demo.POJO.Demo;
import com.example.demo.mapper.DemoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by liupeng on 2017/12/18.
 */
@Service
public class DemoService {
    @Autowired
    private DemoMapper demoMapper;

    @Transactional
    public void save(Demo demo)
    {
        System.out.println(demo.getUsername());
        System.out.println(demo.getPassword());
        demoMapper.save(demo.getUsername(), demo.getPassword());
    }
}
